<?php $this->pageTitle = 'Đăng nhập quản trị hệ thống';?>
<div class="heading">
    <h1><img src="<?php echo Util::themeUrl() ?>/images/header.ico" /><?php echo $this->pageTitle;?></h1>
    <div class="controls">

    </div>
</div>

<div class="content">
	<div class="user-profile">
		<div class="left-column full-width">
			<?php if(Yii::app()->user->hasFlash('loginMessage')): ?>

			<div class="success">
				<?php echo Yii::app()->user->getFlash('loginMessage'); ?>
			</div>

			<?php endif; ?>
			<div class="form">
			<?php echo CHtml::beginForm(); ?>
				<?php if (!empty($model->errors)) :?>
				<div class="errorSummary">
					<p>Tài khoản hoặc mật khẩu không đúng!</p>
				</div>
				<?php endif;?>

				<div class="row">
					<?php echo CHtml::activeLabelEx($model,'username'); ?>
					<?php echo CHtml::activeTextField($model,'username', array('style' => 'width:25%')) ?>
				</div>

				<div class="row">
					<?php echo CHtml::activeLabelEx($model,'password'); ?>
					<?php echo CHtml::activePasswordField($model,'password', array('style' => 'width:25%')) ?>
				</div>

				<div class="row">
					<p class="hint">
					<?php echo CHtml::link(UserModule::t("Lost Password?"),Yii::app()->getModule('user')->recoveryUrl); ?>
					</p>
				</div>

				<div class="row rememberMe">
					<?php echo CHtml::activeCheckBox($model,'rememberMe', array('style' => 'float:left;')); ?>
					<?php echo CHtml::activeLabelEx($model,'rememberMe', array('style' => 'float:left;')); ?>
				</div>
				<div class="clear"></div>
				<div class="row submit">
					<?php echo CHtml::submitButton(UserModule::t("Login"), array('class' => 'controls')); ?>
				</div>

			<?php echo CHtml::endForm(); ?>
			</div><!-- form -->


			<?php
			$form = new CForm(array(
			    'elements'=>array(
			        'username'=>array(
			            'type'=>'text',
			            'maxlength'=>32,
			        ),
			        'password'=>array(
			            'type'=>'password',
			            'maxlength'=>32,
			        ),
			        'rememberMe'=>array(
			            'type'=>'checkbox',
			        )
			    ),

			    'buttons'=>array(
			        'login'=>array(
			            'type'=>'submit',
			            'label'=>'Login',
			        ),
			    ),
			), $model);
			?>
		</div>
	</div>
</div>